var mongoose = require('mongoose');
var dbConfig = require('../config').dbConfig;

var db = mongoose.createConnection('mongodb://' + dbConfig.user + ':' + dbConfig.pass + '@' + dbConfig.host + ':' + dbConfig.port + '/' + dbConfig.name, {
    server: {
        poolSize: dbConfig.poolSize
    }
});

module.exports = {
    Session: db.model('Session', require('./session'))
};